using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;
using System.Windows.Media;

namespace WozLib.Xml
{
  public class ColorXmlSerializable
  {
    [XmlAttribute("A")]
    public float _A = 0.0F;

    [XmlAttribute("R")]
    public float _R = 0.0F;

    [XmlAttribute("G")]
    public float _G = 0.0F;

    [XmlAttribute("B")]
    public float _B = 0.0F;

    [XmlIgnore]
    public Color Color
    {
      get
      {
        return System.Windows.Media.Color.FromScRgb(_A, _R, _G, _B);
      }
    }

    public ColorXmlSerializable(Color color)
    {
      _A = color.ScA;
      _R = color.ScR;
      _G = color.ScG;
      _B = color.ScB;
    }

    public ColorXmlSerializable()
    {
    }
  }
}
